#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>

using namespace std;

class Solution {
public:
    vector<int> constructRectangle(int area) {
        vector<int> ret;
        int numL = sqrt(area);
        while (area % numL != 0) {
            numL--;
        }
        int numW = area / numL;
        if (numW > numL) {
            ret.push_back(numW);
            ret.push_back(numL);
        } else {
            ret.push_back(numL);
            ret.push_back(numW);
        }
        return ret;
    }
};

int main()
{
    Solution s;
    vector<int> ret = s.constructRectangle(30);
    for (auto elem : ret) {
        cout << elem << " ";
    }
    cout << endl;
    return 0;
}